import BIM from '@/editor/KY3D';
import React from 'react';
import Container from './Container';
import styled from 'styled-components';
import Modal from '../component/Modal';

const Ky3d = styled.div`
    /* display: flex; */
    pointer-events: all;
    /* z-index: 1000; */
`


class Editor extends React.Component {

    container = React.createRef<HTMLDivElement>();

    editorview = React.createRef<HTMLDivElement>();

    
    componentDidMount(): void {
        console.log("editor mount")

        if (this.container) {
            BIM.container = this.container.current;
            BIM.SC.scene.mountedMainScene();
        }
        if (this.editorview) {
            BIM.uicontainer = this.editorview.current;
        }
    }

    componentWillUnmount(): void {
        console.log("editor unmount")
        // BIM.exit();
        
    }

    render(): React.ReactNode {
       
        return (
            <>
                <Ky3d id='bim' ref={this.container}/>
                <Container />
                <Modal title='新建方案'>
                    <div>
                        <p> 方案界面内容</p>
                    </div>
                </Modal>
            </>
        )
    }
}

export default Editor